package com.navinfo.platform.trip.common.arithmetic.var;

import com.navinfo.platform.trip.common.arithmetic.SharpTurning_DFN;
import lombok.Data;

import java.util.stream.IntStream;

/**
 * 东风新版急转弯算法{@link SharpTurning_DFN}的统计变量
 */
@Data
public class VarSharpTurning_DFN {
    /**
     * 累积次数
     */
    private int number;
    /**
     * 持续时间，单位ms
     */
    private long duration;
    /**
     * 持续急转弯状态数组，-1未设置，0非急转弯，1急转弯
     */
    private int[] statusArr = {-1, -1, -1, -1, -1};

    public void addNumber(int num){
        number += num;
    }

    public void reset(){
        duration = 0;
        IntStream.range(0, statusArr.length).forEach(i -> statusArr[i]=-1);
    }
}
